<!doctype html charset="utf-8">
<html lang="en" charset="utf-8">
<head>
	<meta charset="UTF-8">
	<title>个人认证</title>
	<link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/gerenxinxi_scss.css">
	<link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/reset.css">
	<script src="<?php echo IMG_PATH ?>bdkd/js/flexible.js"></script>
	<script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>
	<script src="<?php echo IMG_PATH ?>bdkd/js/jquery-1.11.1.min.js"></script>
	<style>
        #imghead{
            margin-top:0 !important;
        }
        #imghead1{
            margin-top:0 !important;
        }
	</style>
</head>
<body>
	<div class="container">
		<div class="waikuang">
			<div class="touxiang">
                <img src="<?php echo $data->path;?>" />
			</div>
			<li>
				<div class="xm">
					<img src="<?php echo IMG_PATH ?>bdkd/img/ren.png" alt="">
					<span class="xingmin-ipt" id="bug">姓名 : <input type="text" id="name" value="<?php echo $data->name;?>" disabled="disabled"></span>
				</div>
				<p class="xiugai1">修改</p>
			</li>
			<li>
				<div class="xm">
					<img src="<?php echo IMG_PATH ?>bdkd/img/trell@2x.png" alt="">
					<span>电话 : <?php echo $data->phone;?></span>
				</div>
			</li>
			<li>
				<div class="xm">
					<img src="<?php echo IMG_PATH ?>bdkd/img/身份证@2x.png" alt="">
					<span class="sfz-ipt" id="bug">身份证 : <input type="text" id="idCard" value="143434434334444434" disabled="disabled"></span>
				</div>
				<p class="tianxie1">填写</p>
			</li>
			<li  onclick="user();">
				<div class="xm">
					<img src="<?php echo IMG_PATH ?>bdkd/img/adress@2x.png" alt="">
<!--                    <input type="text" value=""/>-->
					<span>我的地址 : <i>北京市海淀区友谊路</i></span>
					<img src="<?php echo IMG_PATH ?>bdkd/img/fanhui@2x.png" height="30" width="16" alt="">
				</div>
			</li>
			<div class="xzsf">
				<p>选择身份</p>
			</div>
			<div class="shenfen">
                <span><input class="dxk1" type="radio" name="sex2" value="1">学生</span>
                <span><input class="dxk2" type="radio" name="sex2" value="2">社会人</span>
<!--				<span><img src="--><?php //echo IMG_PATH ?><!--bdkd/img/d.png" height="26" width="26" alt="">学生</span>-->
<!--				<span><img src="--><?php //echo IMG_PATH ?><!--bdkd/img/d.png" height="26" width="26" alt="">社会人</span>-->
<!--                <input class="zhuangtai" type="hidden" value=""/>-->

			</div>
			<div class="shangchuan">
				<div class="zheng">
					<div id="preview">
			            <img id="imghead" border="0" src="<?php echo IMG_PATH ?>bdkd/img/照片-拷贝-2@2x.png"  onclick="$('#previewImg').click();">
			         </div>         
			        <!--<input type="file" onchange="previewImage(this)" style="display: none;" id="previewImg">-->
                    <input type="file" onchange="previewImage(this)" style="display: none;" id="previewImg">
			        <p>身份证正面照</p>
				</div>
				<div class="fan">
					<div id="preview1">
			            <img id="imghead1" border="0" src="<?php echo IMG_PATH ?>bdkd/img/照片-拷贝-2@2x.png"  onclick="$('#previewImg1').click();">
			         </div>         
			        <!--<input type="file" onchange="previewImage1(this)" style="display: none;" id="previewImg1">-->
                    <input type="file" onchange="previewImage1(this)" style="display: none;" id="previewImg1">
			        <p>身份证反面照</p>
				</div>
				<span>*快递实行实名制，建议上传照片</span>
			</div>
			<div class="birth">
				<p><img src="<?php echo IMG_PATH ?>bdkd/img/dangao@2x.png" alt=""><span>我的生日</span><span>( 有礼物哦 )</span></p>
				<div class="data">
					<div class="nyr">
						<input type="text" id="year" value="2017">
						<span>年</span>
						<input type="text" id="month" value="12" >
						<span>月</span>
						<input type="text" id="day" value="25">
						<span>日</span>
					</div>
					<span><img src="<?php echo IMG_PATH ?>bdkd/img/d.png" alt="">农历</span>
				</div>
			</div>
			<a style="text-decoration: none"><div class="btn" onclick="upuser()">认证</div></a>
		</div>
	</div>
	<script src="<?php echo IMG_PATH ?>bdkd/js/gerenxinxi.js"></script>
	<script>


        function user() {
            window.location.href = '<?php echo SITE_PATH ?>work/buser/uaddres';
        }

        function upuser() {
            alert(222);return false;
            var name=$("#name").val();
            //var phone=
            var idCard=$("#idCard").val();
            var identity=$("input[type='radio']:checked").val();
            alert(identity);
            var year=$("#year").val();
            var month=$("#month").val();
            var day=$("#day").val();
            var birthday=year+'-'+month+'-'+day;
            //alert(birthday);


            $.ajax({
                // 请求发送方式
                type: 'post',
                // 验证文件
                url: '<?php echo SITE_PATH ?>work/buser/upUser',
                dataType:'json',
                // 用户输入的帐号验证码
                data: {
                    'name':name,
                    'idcard':idCard,
                    'identity':1,
                    'birthday':birthday
                },
                success: function(data){
                    console.log(data);
                    if(data.result==1){
                        alert("修改成功!");

                    }else{
                        alert(data.msg);
                    }
                },
                error: function(){
                    alert('提交失败55!');
                }

            })
        }

        





        var custom_num=0;
        function custom_huantu(ele){

            var tupian1 = $(ele).attr("src");
            var newSrc = tupian1 === '<?php echo IMG_PATH ?>bdkd/img/d.png'?'<?php echo IMG_PATH ?>bdkd/img/l.png':'<?php echo IMG_PATH ?>bdkd/img/d.png';
            $(ele).attr("src",newSrc);
        }
//        function custom_huantu2(ele){
//            var tupian1 = $(ele).attr("src");
//            $(".shenfen span img").each(function(index,item){
//                $(item).attr("src","<?php //echo IMG_PATH ?>//bdkd/img/d.png");
//            });
//            var newSrc = tupian1 === '<?php //echo IMG_PATH ?>//bdkd/img/d.png'?'<?php //echo IMG_PATH ?>//bdkd/img/l.png':'<?php //echo IMG_PATH ?>//bdkd/img/d.png';
//            $(ele).attr("src",newSrc);
//        }
        /*死函数*/
        /*运费估算*/
//        $(".shenfen span img").each(function(index,item){
//
//            $(item).click(function(){
//                custom_huantu2(this);
//                 var a = index;
//                console.log(a);
//                $('.zhuangtai').attr("value",a);
//            });
//        });
//        console.log($('.zhuangtai').val());
        $('.data span img').click(function(){
            custom_huantu(this);
            custom_num=custom_num===0?1:0;
        })


        $('.xiugai1').click(function(){

            $('.xingmin-ipt input').val('');
            $('.xingmin-ipt input').removeAttr('disabled');

            $('.xingmin-ipt input').focus(function(){
//                console.log($('.xingmin-ipt input').val().length);
                if($('.xingmin-ipt input').val().length>1){
//                    console.log('dasf');
                    $('.xingmin-ipt input').attr('disabled','true');
                }
            })
        })
        $('.tianxie1').click(function(){
            $('.sfz-ipt input').val('');
            $('.sfz-ipt input').removeAttr('disabled');
            $('.sfz-ipt input').focus(function(){

                $('.sfz-ipt input').blur(function(){
                    if($('.sfz-ipt input').val().length>=18){
                        console.log($('.sfz-ipt input').val().length);
                        var sfzh = $('.sfz-ipt input').val().substring(0,6);
                        var sfzh1 = $('.sfz-ipt input').val().substring(14,18);
                        console.log(sfzh1);
                        console.log(sfzh);
                        var sfzh2 = sfzh+'********'+sfzh1;
                        $('.sfz-ipt input').val(sfzh2);
                        $('.sfz-ipt input').attr('disabled','true');
                    }
                })
            })
        })
        window.onload=function(){
            var g=localStorage;
            var rjx ='';
            var grxi_dz = g.getItem('fxxxx');
            var grxi_dz1 = g.getItem('fxinxi');
            rjx = grxi_dz+grxi_dz1;
            function Trim(rjx)
            {
                return rjx.replace(/(^\s*)|(\s*$)/g, "");
            }
            console.log(rjx);
            var dizhi = $('.xm span i').html(rjx);
            if($('.xm span i').html().length>=9){

                var dizhi1 = $('.xm span i').html().substring(0,9);
                console.log(dizhi1);
                var dizhi2 = dizhi1+'…';
                $('.xm span i').html(dizhi2);

            }

        }

    </script>
</body>
</html>